package com.angus.common.core.enums;

import lombok.Getter;

/**
 * @author liyanan
 * @date 2024/12/22 10:04 AM
 * @description
 */
@Getter
public enum PayType {

    PC(1,"FAST_INSTANT_TRADE_PAY", "电脑网站"),
    PHONE(2, "QUICK_WAP_WAY","手机网站");



    private final Integer typeFlag;
    private final String typeCode;
    private final String typeName;

    PayType(Integer typeFlag, String typeCode, String typeName) {
        this.typeFlag = typeFlag;
        this.typeCode = typeCode;
        this.typeName = typeName;
    }

    public static String fromFlag(Integer typeFlag) {
        PayType[] values = PayType.values();
        for (PayType value : values) {
            if (value.getTypeFlag().equals(typeFlag)) {
                return value.getTypeCode();
            }
        }
        return "UNKNOWN";
    }


}
